<?php
require "setup.php";
require "top_page.php";
?>

<h1>Status</h1>

<?php
	$res=status();
	$album=tracks($res["ALBUM_NO"]);
?>

<table class="status">
<tr><th><?php echo _("Status"); ?></th><td><?php if($pausing) echo _("Pausing"); else if($playing) echo _("Playing"); else echo _("Nothing playing"); ?></td></tr>
<tr><th><?php echo _("Name"); ?></th><td><a href="albums.php?album=<?=$res["ALBUM_NO"]?>&amp;track=<?=$res["TRACK_NO"]?>"><?php echo $res["TITLE"]; ?></a></td></tr>
<tr><th><?php echo _("Album"); ?></th><td><a href="albums.php?album=<?=$res["ALBUM_NO"]?>"><?=$album["ALBUMNAME"]?></a></td></tr>
<tr><th><?php echo _("Artist"); ?></th><td><?php echo $res["ARTIST"]; ?></td></tr>
<tr><th><?php echo _("Play since"); ?></th><td><?php echo date("G:i:s",$res["DATE"]); ?></td></tr>
<tr><th><?php echo _("Filter"); ?></th><td><?php if($res["FILTER"] != "") echo $res["FILTER"]; else echo _("Desactived"); ?></td></tr>
<?php
if($res["FILTER"] != "") { 
?>
<tr><th>&gt; <?php echo _("Include"); ?></th><td><?php echo $res["TRACK_INCLUDE"]; ?></td></tr>
<tr><th>&gt; <?php echo _("Exclude"); ?></th><td><?php echo $res["TRACK_EXCLUDE"]; ?></td></tr>
<?php
} else {
?>
<tr><th><?php echo _("Songs availables"); ?></th><td><?php echo $res["TRACK_INCLUDE"]; ?></td></tr>
<?php
}
?>
<tr><th><?php echo _("Random"); ?></th><td><?php echo $res["RANDOM"]." (".$res["RANDOM_WEIGHT"].")"; ?></td></tr>
</table>

<br/>
<table class="ratings">
	<tr><th><?php echo _("User"); ?></th><th><?php echo _("Rating"); ?></th></tr>
<?php
	$res=ratings($_GET["album"], $_GET["track"]);
	for($i = 0; $i < $res["COUNT"]; $i++) {
		echo "<tr><td>".$res["$i"]["USER"]."</td><td>"._($res["$i"]["RATING"])."</td></tr>";
	}
?>
</table>

<?php
require "bottom_page.php";
?>
